STATUS = [
["New, in analysis", 10],
["Accepted", 20],
["Spec in progress", 30],
["Validated", 50],
["Dev in progress", 60],
["Unit Test OK", 70],
["Int Tests OK", 80],
["System Tests OK", 90],
["Delivered", 100],
["Client tests OK", 110],
["In production", 120],
["Rejected", 130]
]

PRIO = [
["Nice to have",3],
["Normal",2],
["Urgent",1],
["Blocking",0]
]

module RequirementsHelper

  def self.id_to_status(id)
    STATUS.each { |text, i|
      return text if id == i
      }
    "?"
  end

  def self.id_to_style(id)
    return "status_nil" if id == nil
    return "status_todo" if id < 60
    return "status_inprogress" if id < 100
    return "status_ok"
  end

  def self.id_to_prio(id)
    PRIO.each { |text, i|
      return text if id == i
      }
    "?"
  end
  
end

